<template>
<div class="dv">组件生命周期</div>
<p>{{msg}}</p>
</template>
<script>
export default{
    data(){
        return{
          msg:"Vue.js"
        }
    },
      beforeCreate(){
                console.log("实例创建前："+this.msg);
            },
            created(){
                console.log("实例创建后："+this.msg);
                
            }
}



// import { onBeforeMount, onMounted } from 'vue';

// onBeforeMount(()=>{
//     console.log("Dom元素渲染之前",document.querySelector(".dv"));
    
// })
// onMounted(()=>{
//     console.log("Dom元素渲染之后",document.querySelector(".dv"));
    
// })
</script>